<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Page 4 zxt.ui.scroller</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="app/jsUnitCore.js"></script>
<script type="text/javascript" src="../zxt/zxt.js"></script>
<script>
	importZXT("../zxt");
</script>
<script type="text/javascript" src="test_zxt.scroller.js"></script>
</head>
<body>
<p id = "a" >
	This is a simple test page for addTwoNumbers(value1, value2).
</p>
<table cellspacing=0 cellpadding=0 border=0>
	<tr>
	  <td><div id="nav"></div></td>
	</tr>
	<tr>
		<td><div id="grid" class="containerBody" style='overflow:auto;width:100%'></div></td>
	</tr>
	</table>
</body>
<script>

</script>
<script>

	var data = new Array();
	data.push({id:"179371", name:"Han Qiuming", sex:"Male", birthday:"1976-11-12", ip: "127.0.0.1" });	
	
	data.push({id:"179392", name:"Zhao Xingbo", sex:"Male", birthday:"1976-11-12", ip: "127.0.0.1"});	
	data.push({id:"180001", name:"Zhou Laijun", sex:"Male", birthday:"1976-11-12", ip: "127.0.0.1"});
	for(var i=0; i<55; i++){
		var id = 18002 + i;
		data.push({id: id+"", name:"NAME", sex:"Male", birthday:"1976-11-12", ip: "127.0.0.1"});
	}		  	
		
	var colId = new zxt.data.TableModel("id", "ID", "ID", "text", true, false);
	var colName = new zxt.data.TableModel("name", "NAME", "NAME", "text", false, false);	
	
	var conf = { Male:"��", Female: "Ů" };
		  
	var colSex = new zxt.data.TableModel("sex", "SEX", "SEX", "select", false, false, conf);
	var colBir = new zxt.data.TableModel("birthday", "BIRTH", "BIRTHDAY", "date", false, false);
	var colIP = new zxt.data.TableModel("ip", "IP", "IP", "ip", false, false);
	
	var tmodel = new ListTableModel(data, [colId, colName, colSex, colBir, colIP]);
</script>

<script>			
	var dGrid = new zxt.ui.ZxtModeGrid(tmodel); 
	var renderD = function(grid, idx){
		var row = grid.getModelRow(idx);					
		return "<div><input type='button' value='"+ row.name +"' onclick='alert(\"abc\")'></div>";	  		
	};			
	dGrid.addColumn({ name:"detail", title: "TTT", width: 140, render: renderD} );
	
	var dNavigator = new zxt.ui.ZxtDataPager(tmodel);
	dNavigator.addListener(dGrid);
		
	var dScroller = new zxt.ui.ZxtDataScroller(tmodel);
	dScroller.addListener(dGrid);
		
	$("#grid").get(0).appendChild( dGrid.render() );
	$("#nav").append( dNavigator.render() );
	
	function saveItem(){			
		//var row = dGrid.getNowRow(0);
		var sels = dGrid.checked();
		
		ZxtUtil.object.alert(sels);
	}
</script>
</html>